package com.lims.landInfo.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;


import javacommon.base.*;

import cn.org.rapid_framework.util.*;

/**
 * @author zzh
 * @version 1.0
 * @since 1.0
 */
@Entity
@Table(name = "LIMS_Book")
public class Book extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//date formats
	public static final String FORMAT_LAND_DATE = DATE_FORMAT;
	public static final String FORMAT_CREATE_DATE = DATE_FORMAT;
	

	//columns START
    /**
     * objid       db_column: OBJID 
     */ 	
	private java.lang.String objid;
    /**
     * sno       db_column: sno 
     */ 	
	private java.lang.Integer sno;
    /**
     * landno       db_column: landno 
     */ 	
	private java.lang.String landno;
    /**
     * originalAmount       db_column: originalAmount 
     */ 	
	private java.lang.Double originalAmount;
    /**
     * intangibleAmount       db_column: intangibleAmount 
     */ 	
	private java.lang.Double intangibleAmount;
    /**
     * fixedAmount       db_column: fixedAmount 
     */ 	
	private java.lang.Double fixedAmount;
    /**
     * processAmount       db_column: processAmount 
     */ 	
	private java.lang.Double processAmount;
    /**
     * otherAmount       db_column: otherAmount 
     */ 	
	private java.lang.Double otherAmount;
    /**
     * netWorth       db_column: netWorth 
     */ 	
	private java.lang.Double netWorth;
    /**
     * isPurchase       db_column: isPurchase 
     */ 	
	private java.lang.Integer isPurchase;
    /**
     * purchaseAmount       db_column: purchaseAmount 
     */ 	
	private java.lang.Double purchaseAmount;
    /**
     * changeType       db_column: changeType 
     */ 	
	private java.lang.Integer changeType;
    /**
     * oldno       db_column: oldno 
     */ 	
	private java.lang.String oldno;
    /**
     * oldContent       db_column: oldContent 
     */ 	
	private java.lang.String oldContent;
    /**
     * describe       db_column: describe 
     */ 	
	private java.lang.String describe;
    /**
     * landDate       db_column: landDate 
     */ 	
	private java.util.Date landDate;
    /**
     * createDate       db_column: createDate 
     */ 	
	private java.util.Date createDate;
	//columns END


	public Book(){
	}

	public Book(
		java.lang.String objid
	){
		this.objid = objid;
	}

	

	public void setObjid(java.lang.String value) {
		this.objid = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid")
	@Column(name = "OBJID",  nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getObjid() {
		return this.objid;
	}
	
	@Column(name = "sno", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getSno() {
		return this.sno;
	}
	
	public void setSno(java.lang.Integer value) {
		this.sno = value;
	}
	
	@Column(name = "landno", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public java.lang.String getLandno() {
		return this.landno;
	}
	
	public void setLandno(java.lang.String value) {
		this.landno = value;
	}
	
	@Column(name = "originalAmount", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getOriginalAmount() {
		return this.originalAmount;
	}
	
	public void setOriginalAmount(java.lang.Double value) {
		this.originalAmount = value;
	}
	
	@Column(name = "intangibleAmount", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getIntangibleAmount() {
		return this.intangibleAmount;
	}
	
	public void setIntangibleAmount(java.lang.Double value) {
		this.intangibleAmount = value;
	}
	
	@Column(name = "fixedAmount", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getFixedAmount() {
		return this.fixedAmount;
	}
	
	public void setFixedAmount(java.lang.Double value) {
		this.fixedAmount = value;
	}
	
	@Column(name = "processAmount", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getProcessAmount() {
		return this.processAmount;
	}
	
	public void setProcessAmount(java.lang.Double value) {
		this.processAmount = value;
	}
	
	@Column(name = "otherAmount", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getOtherAmount() {
		return this.otherAmount;
	}
	
	public void setOtherAmount(java.lang.Double value) {
		this.otherAmount = value;
	}
	
	@Column(name = "netWorth", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getNetWorth() {
		return this.netWorth;
	}
	
	public void setNetWorth(java.lang.Double value) {
		this.netWorth = value;
	}
	
	@Column(name = "isPurchase", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getIsPurchase() {
		return this.isPurchase;
	}
	
	public void setIsPurchase(java.lang.Integer value) {
		this.isPurchase = value;
	}
	
	@Column(name = "purchaseAmount", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getPurchaseAmount() {
		return this.purchaseAmount;
	}
	
	public void setPurchaseAmount(java.lang.Double value) {
		this.purchaseAmount = value;
	}
	
	@Column(name = "changeType", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getChangeType() {
		return this.changeType;
	}
	
	public void setChangeType(java.lang.Integer value) {
		this.changeType = value;
	}
	
	@Column(name = "oldno", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getOldno() {
		return this.oldno;
	}
	
	public void setOldno(java.lang.String value) {
		this.oldno = value;
	}
	
	@Column(name = "oldContent", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getOldContent() {
		return this.oldContent;
	}
	
	public void setOldContent(java.lang.String value) {
		this.oldContent = value;
	}
	
	@Column(name = "describe", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getDescribe() {
		return this.describe;
	}
	
	public void setDescribe(java.lang.String value) {
		this.describe = value;
	}
	
	@Transient
	public String getLandDateString() {
		return DateConvertUtils.format(getLandDate(), FORMAT_LAND_DATE);
	}
	public void setLandDateString(String value) {
		setLandDate(DateConvertUtils.parse(value, FORMAT_LAND_DATE,java.util.Date.class));
	}
	
	@Column(name = "landDate", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public java.util.Date getLandDate() {
		return this.landDate;
	}
	
	public void setLandDate(java.util.Date value) {
		this.landDate = value;
	}
	
	@Transient
	public String getCreateDateString() {
		return DateConvertUtils.format(getCreateDate(), FORMAT_CREATE_DATE);
	}
	public void setCreateDateString(String value) {
		setCreateDate(DateConvertUtils.parse(value, FORMAT_CREATE_DATE,java.util.Date.class));
	}
	
	@Column(name = "createDate", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public java.util.Date getCreateDate() {
		return this.createDate;
	}
	
	public void setCreateDate(java.util.Date value) {
		this.createDate = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Objid",getObjid())
			.append("Sno",getSno())
			.append("Landno",getLandno())
			.append("OriginalAmount",getOriginalAmount())
			.append("IntangibleAmount",getIntangibleAmount())
			.append("FixedAmount",getFixedAmount())
			.append("ProcessAmount",getProcessAmount())
			.append("OtherAmount",getOtherAmount())
			.append("NetWorth",getNetWorth())
			.append("IsPurchase",getIsPurchase())
			.append("PurchaseAmount",getPurchaseAmount())
			.append("ChangeType",getChangeType())
			.append("Oldno",getOldno())
			.append("OldContent",getOldContent())
			.append("Describe",getDescribe())
			.append("LandDate",getLandDate())
			.append("CreateDate",getCreateDate())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getObjid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Book == false) return false;
		if(this == obj) return true;
		Book other = (Book)obj;
		return new EqualsBuilder()
			.append(getObjid(),other.getObjid())
			.isEquals();
	}
}

